package cn.always.xiajia.admin.sys.entity;

import java.util.ArrayList;
import java.util.List;

import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import cn.always.xiajia.framework.mybatis.core.entity.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * 部门
 * 
 * @author xgj
 *
 */
@TableName(value = "sys_dept", autoResultMap = true)
@KeySequence("sys_dept_seq")
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class SysDept extends BaseEntity {

	private static final long serialVersionUID = 5189788762777916661L;

	/**
	 * 部门ID
	 */
	@TableId
	private Long deptId;

	/**
	 * 父部门ID
	 */
	private Long parentId;

	/**
	 * 祖级列表
	 */
	private String ancestors;

	/**
	 * 部门编码
	 */
	private String deptCode;

	/**
	 * 部门名称
	 */
	private String deptName;

	/**
	 * 显示顺序
	 */
	private Integer orderNum;

	/**
	 * 负责人
	 */
	private String leader;

	/**
	 * 联系电话
	 */
	private String phone;

	/**
	 * 邮箱
	 */
	private String email;

	/**
	 * 部门状态:0正常,1停用
	 */
	private String status;

	/**
	 * 备注
	 */
	private String remark;

	/**
	 * 子部门
	 */
	@TableField(exist = false)
	private List<SysDept> children = new ArrayList<>();

}
